<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:c="http://java.sun.com/jsp/jstl/core">

<p:panel header="#{msg['right.connexion']}">
<h:form id="connexionForm">
		<h:panelGrid columns="2" rendered="#{!connexionManagedBean.connected}">  
	            <h:outputText value="#{msg['right.identifiant']}" />
	            <p:inputText value="#{connexionManagedBean.identifiant}" style="width:90%;" />
	            <h:outputText value="#{msg['right.motDePasse']}" />
	            <p:password value="#{connexionManagedBean.password}" style="width:90%;" />
	            <h:outputText value="#{msg['right.rememberMe']}" />
	            <h:selectBooleanCheckbox value="#{connexionManagedBean.rememberMe}" />
	            <h:outputText />
	            <p:commandButton action="#{connexionManagedBean.connect}" value="#{msg['right.connexion']}" ajax="false" /> 
	    </h:panelGrid>
	    <h:link value="#{msg['right.inscription']}" 
	    		outcome="registration" 
	    		rendered="#{!connexionManagedBean.connected}"/> 
	
	<c:if test="#{connexionManagedBean.connected}">
	    <h:outputText  value="#{msg['right.bonjour']} #{connexionManagedBean.identifiant}"/>
	    <br/>
	    <br/>
	    <c:if test="#{connexionManagedBean.hasAvatar()}">
	    	<h:graphicImage value="#{connexionManagedBean.avatar}" alt="avatar" />
	    	<br/>
	    	<br/>
	    </c:if>
	    <p:commandButton action="#{connexionManagedBean.disconnect}" value="#{msg['right.deconnexion']}" ajax="false"/>
		<br/>
		<br/>
		<h:link value="#{msg['right.profil']}" outcome="profil" />
		<br/>
		<h:link value="Voir l'historique de vos commandes" outcome="historique"  />
	</c:if>
</h:form>
<p:message for="connexionForm" showSummary="false" showDetail="true"/>



</p:panel>


</html>